package cn.com.longfuinfo.wx.service;

import java.util.List;

import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Record;

import cn.com.longfuinfo.wx.dao.Ad;

public class StoreService {
	
	/**
	 * 查询指定店铺的广告位（只显示在微信商城显示的）
	 */
	public List<Ad> findAd(){
		return Ad.me().find("SELECT id,thumb,link FROM t_bus_ad ORDER BY orderNo ASC");
	}
	
	/**
	 * 查询指定店铺的最新一条通知
	 */
	public Record findLastTip(int storeid){
		return Db.findFirst("SELECT content FROM t_dict_store_tip WHERE storeid=? ORDER BY orderNo",storeid);
	}

	public List<Record> findCity() {
		return Db.find("select id,name from t_dict_city where type=2");
	}

	public Record getCity(int cityId) {
		return Db.findFirst("select id,name from t_dict_city where id=?",cityId);
	}
}
